Repository navigation
HybridParser now ends shortcode names at syntax tokens - #130
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HybridParsermatched shortcode names with a fixed character list, so with a syntax that uses-,*or_as a token, the name took that token too: with-as the marker,[a-]gave the namea-withHybridParserandawithRegularParser.HybridParseris not in any tag yet, so this changes nothing for released versions.HybridParsermatchesRegularParseron 20000 random texts for each of 6 syntaxes that use-,*or_as a token, from 6500-12700 differences to 0 on PHP 5.5-8.5,HybridParseroutput as master with the default and{}syntaxes on PHP 5.5-8.5,With JIT the speed is the same: 1MB of text takes 24.5ms before and 23.9ms after on PHP 8.4. Without JIT, on text made only of long names, 1MB takes 29ms before and 74ms after on PHP 8.4, and 182ms and 218ms on PHP 5.6.
Without JIT, a name of 200000 characters or more now fails with PCRE error 2, the same as in
RegularParser. With JIT, a name of 1000000 characters still parses, and an unclosed one no longer fails.